package com.edu.service.impl;

import com.edu.bean.Book;
import com.edu.mapper.BookMapper;
import com.edu.service.BookService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service

public class BookServiceImpl implements BookService {

    @Resource
    private BookMapper bookMapper;

    @Override
    public List<Book> getAllBooks() {
        return bookMapper.selectAllBook();
    }

    @Override
    public List<Book> getTypes() {
        return bookMapper.selectType();
    }

    @Override
    public List<Book> getSomeBooks(Book book) {
        return bookMapper.selectSomeBook(book);
    }

    @Override
    public int deleteBookById(int bookId) {
        return bookMapper.deleteBookById(bookId);
    }

    @Override
    public int addBook(Book book) {
        return bookMapper.insertBook(book);
    }
}
